import { createApp } from 'vue'
import DataVVue3 from '@kjgl77/datav-vue3'
import App from './App.vue'
const app = createApp(App)
app.use(DataVVue3)

import store from './store'
app.use(store)

import router from './router'
app.use(router)

import Print from 'vue3-print-nb'
app.use(Print);
// import 'uno.css'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
app.use(ElementPlus, {
    size: store.state.settings.elementSize
})

import { useI18n } from './locales'
useI18n(app)

import Particles from 'vue3-particles'
app.use(Particles)

import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
import ContextMenu from '@imengyu/vue3-context-menu'
app.use(ContextMenu)

import globalProperties from '@/util/global.properties'
globalProperties(app)

// 自定义指令
import directive from '@/util/directive'
directive(app)

// 全局组件自动注册
import registerGlobalComponent from '@/components/registerGlobalComponent'
registerGlobalComponent(app)

// 错误日志上报
import errorLog from '@/util/error.log'
errorLog(app)

// 加载 svg 图标
import 'vite-plugin-svg-icons/register'
import 'remixicon/fonts/remixicon.css'

// 全局样式
import '@/assets/styles/globals.scss'
import apis from '@/api/apis'
app.config.globalProperties.$apis = apis

//icon
import './assets/fonts/fonts-creen/iconfont.css'
import './assets/fonts/font-map/iconfont.css'

// 时间转换
import getTime from '@/util/getTime'
app.config.globalProperties.$getTime = getTime

// 隐患时间转换
import dangerTime from '@/util/dangerTime'
app.config.globalProperties.$dangerTime = dangerTime

// 获取经纬度
import getMap from '@/util/getMap'
app.config.globalProperties.$getMap = getMap

// 复制
import VueClipboard from 'vue-clipboard2'
app.use(VueClipboard)

// 时间转换
import ws from '@/util/socket'
app.config.globalProperties.$ws = ws

import getDateTime from '@/util/getDateTime'
app.config.globalProperties.$getDateTime = getDateTime

// PWA
// import './pwa'

app.mount('#app')
